# Contributor: larchunix
# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=libmodulemd
pkgver=2.15.0
pkgrel=1
pkgdesc="C Library for manipulating module metadata files"
arch=('loong64' 'x86_64')
url="https://github.com/fedora-modularity/$pkgname"
license=('MIT')
depends=('file' 'glib2' 'libyaml' 'rpm-tools')
makedepends=('gobject-introspection' 'gtk-doc' 'help2man' 'meson' 'python-gobject')
optdepends=('python-gobject: for python bindings')
source=("$url/releases/download/$pkgver/${pkgname#lib}-$pkgver.tar.xz")
sha256sums=('15458323d1d1f614f9e706f623794f95d23e59f4c37deeaa16877463aee34af5')

build() {
  cd ${pkgname#lib}-$pkgver
  arch-meson build
  ninja -C build
}

check() {
  cd ${pkgname#lib}-$pkgver
  ninja -C build test
}

package() {
  cd ${pkgname#lib}-$pkgver
  DESTDIR="$pkgdir/" ninja -C build install

  install -Dp -m644 COPYING   "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  install -Dp -m644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
